import request from '@/utils/request'
/**
 *
 * 员工管理
 *
 **/
// 登录
export const login = (data: any) =>
  request({
    'url': '/admin/login',
    'method': 'post',
    data: data
  })

  // 退出
 export const userLogout = (params: any) =>
 request({
   'url': `/admin/logout`,
   'method': 'post',
   params
 })

 //分页查询
 export const getAdminList = (params: any) =>
  request({
    'url': `/admin/page`,
    'method': 'get',
    params
  })
 
   //启用禁用
 export const enableOrDisableEmployee = (params: any) =>
  request({
    'url': `/admin/status/${params.status}`,
    'method': 'post',
    params:{id: params.id}
  })

    //新增员工
 export const addEmployee = (params: any) =>
  request({
    'url': '/admin',
    'method': 'post',
    data:params
  })

    //根据id查询员工
 export const findEmployeeById = (id: number) =>
  request({
    'url': `/admin/${id}`,
    'method': 'get',
  })

      //更新员工
 export const updateEmployee = (params: any) =>
  request({
    'url': '/admin',
    'method': 'put',
    data:params
  })